﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace AuroraPlatform.ViewModel
{
    public enum PageLevel
    {
        First,
        Second,
        Third,
        Fourth,
        Fifth
    }

    public class BusinessContext : INotifyPropertyChanged
    {
        private static readonly BusinessContext _singleton = new BusinessContext();
        private static readonly ParamIterator _iterator = new ParamIterator();
        private ObservableCollection<LightingListModel> _items = new ObservableCollection<LightingListModel>();
        private PageLevel _targetPage;
        private User _user;
        private int _cartCount;

        private bool _delStatus;

        public bool DelStatus
        {
            get { return _delStatus; }
            set
            {
                _delStatus = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("DelStatus"));
            }
        }

        public ObservableCollection<LightingListModel> Items
        {
            get
            {
                return _items;
            }
        }

        public int CartCount
        {
            get { return _cartCount; }
            set
            {
                _cartCount = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("CartCount"));
            }
        }

        public static BusinessContext Singleton
        {
            get
            {
                return _singleton;
            }
        }

        public ParamIterator ParamIterator
        {
            get { return _iterator; }
        }

        public PageLevel TargetPage
        {
            get { return _targetPage; }
            set
            {
                _targetPage = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("TargetPage"));
            }
        }


        public User User
        {
            get { return _user; }
            set
            {
                _user = value;
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs("User"));
            }
        }

        public string WebServiceUrl { get; set; }
        public string ImageUrl { get; set; }



        public event PropertyChangedEventHandler PropertyChanged;

        private BusinessContext()
        {
        }
    }
}
